
package com.dsunsoft.rtu.common.exception;

import com.dsunsoft.rtu.common.entity.RestCode;

/**
 * 自定义异常基类
 * 
 * @author ygm
 *
 */
public class BaseException extends RuntimeException {
	private static final long serialVersionUID = 2251651646786897624L;

	/**
	 * 状态码
	 */
	private int code;

	public BaseException(String message) {
		super(message);
		this.code = RestCode.FAILURE.getValue();
	}

	public BaseException(RestCode restCode, String message) {
		super(message);
		this.code = restCode.getValue();
	}

	public int getCode() {
		return code;
	}

	public void setCode(int code) {
		this.code = code;
	}
}
